<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" type="text/css" href="../resources/css/styles.css">
    <script type="text/javascript" src="../resources/js/d3.js"></script>
</head>
<body>
<div></div>
<div></div>
<div></div>

<script type="text/javascript">
    d3.selectAll("div")
            .attr("class","red box")
            .each(function(d, i){
                d3.select(this).append("h1").text(i);
            });
</script>
</body>
</html>